package com.netease.nie.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.netease.nie.dao.OrdersAddressDao;
import com.netease.nie.dao.OrdersTraceDao;
import com.netease.nie.model.OrdersAddress;
import com.netease.nie.model.OrdersTrace;

@Service
public class ConfirmedOrdersAddressImpl implements
		ConfirmedOrdersAddressService {

	@Autowired
	private OrdersAddressDao ordersAddressDao;
	
	@Autowired
	private OrdersTraceDao ordersTraceDao;

	@Transactional(rollbackFor = Exception.class)
	public int confirmed(OrdersAddress ordersAddress,
			OrdersTrace ordersTrace) throws Exception {
		ordersAddressDao.insertOrdersAddress(ordersAddress);
		ordersTraceDao.insertOrdersTrace(ordersTrace);
		return 1;
	}
}
